package com.neusoft.bizcore.activiti.enums;

import java.util.Arrays;
import java.util.List;

public enum EventTypeEnum implements IDictionary {
    create(1, "创建"),
    update(2, "更新"),
    delete(3, "删除"),
    finish(4, "完成");

    private int value;
    private String label;

    private EventTypeEnum(final int value, final String label) {
        this.value = value;
        this.label = label;
    }

    @Override
    public int getValue() {
        return this.value;
    }

    @Override
    public String getLabel() {
        return this.label;
    }

    public static EventTypeEnum parse(final int value) {
        EventTypeEnum result = null;
        switch (value) {
        case 1:
            result = EventTypeEnum.create;
            break;
        case 2:
            result = EventTypeEnum.update;
            break;
        case 3:
            result = EventTypeEnum.delete;
            break;
        case 4:
            result = EventTypeEnum.finish;
            break;
        }
        return result;
    }

    public static List<EventTypeEnum> getEnumValues() {
        return Arrays.asList(EventTypeEnum.values());
    }

}
